using MediatR;
using RBAC.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace RBAC.Write.Api.Application.Command.ERP.MaterialFile
{
    /// <summary>
    /// 创建物料基本档案命令
    /// </summary>
    public class CreateMaterialCommand : IRequest<APIResult<long>>
    {
        /// <summary>
        /// 物料编码
        /// </summary>
        [Required(ErrorMessage = "物料编码不能为空")]
        [StringLength(50, ErrorMessage = "物料编码长度不能超过50个字符")]
        public string MaterCode { get; set; } = string.Empty;

        /// <summary>
        /// 物料名称
        /// </summary>
        [Required(ErrorMessage = "物料名称不能为空")]
        [StringLength(100, ErrorMessage = "物料名称长度不能超过100个字符")]
        public string MaterName { get; set; } = string.Empty;

        /// <summary>
        /// 主计量单位
        /// </summary>
        [StringLength(20, ErrorMessage = "主计量单位长度不能超过20个字符")]
        public string? Unit { get; set; }

        /// <summary>
        /// 供应方式：采购、自制、委外、装配、生产
        /// </summary>
        [StringLength(20, ErrorMessage = "供应方式长度不能超过20个字符")]
        public string? SupplyMode { get; set; }

        /// <summary>
        /// 型号规格
        /// </summary>
        [StringLength(200, ErrorMessage = "型号规格长度不能超过200个字符")]
        public string? ModelSpec { get; set; }

        /// <summary>
        /// 图纸号
        /// </summary>
        [StringLength(100, ErrorMessage = "图纸号长度不能超过100个字符")]
        public string? DrawingNo { get; set; }

        /// <summary>
        /// 规格描述
        /// </summary>
        [StringLength(500, ErrorMessage = "规格描述长度不能超过500个字符")]
        public string? SpecDesc { get; set; }

        /// <summary>
        /// 物料分类ID
        /// </summary>
        public long? MaterTypeId { get; set; }

        /// <summary>
        /// 状态：1-正常，0-停用
        /// </summary>
        public int Status { get; set; } = 1;


    }
}